package ModuleList;

use strict;
use warnings;

sub new {
    my $class = shift;
    my $self  = {};
    bless $self, $class;
    return $self;
}

sub get_modules {
  my $self = shift or die "no object";
  my @modules;

  push @modules, "Module::Build";

  push @modules, qw(
    Test::Harness
    String::Random
    File::Slurp
    Catalyst
    Catalyst::Plugin::ConfigLoader
    Catalyst::Plugin::SubRequest
    Catalyst::Plugin::Session::State::Cookie
    Catalyst::Plugin::Static::Simple
    Catalyst::Plugin::StackTrace
    Catalyst::Plugin::Auth::Utils
    Catalyst::Plugin::Authentication
    Catalyst::Plugin::Authentication::Store::DBIC
    Catalyst::Plugin::Authentication::Credential::Password
    Catalyst::Plugin::Authorization::Roles
    Catalyst::Plugin::Authorization::ACL
    Catalyst::Plugin::Session
    Catalyst::View::TT
    Catalyst::Controller::FormBuilder
    Algorithm::C3
    Class::C3
    DBIx::Class
    DBIx::Class::Schema::Loader
    Catalyst::Model::DBIC::Schema
    Lingua::EN::Inflect::Number
    Catalyst::Action::RenderView
    DBD::Pg
    DateTime
    Email::Send
  );

  #fussy about needing prereq installed
  push @modules, qw(
    Cache::FastMmap
    Catalyst::Plugin::Session::Store::FastMmap
  );

  #needed for DBIX::Class::DigestColumns
  push @modules, qw (
    IO::Scalar
    Text::RecordParser
  );
  # thought this was needed for DBIX::Class::DigestColumns install, but I guess it's not.
  #push @modules, "SQL::Translator";

  #hoping to use this to make one shot more oneshot.
  push @modules, qw(
    Sysadm::Install
    String::ShellQuote
  );

  # needed for most recent version (svn) version of Catalyst::Example::InstantCrud
  push @modules, qw(
    Catalyst::Devel
    Template::Plugin::Class
  );

  return @modules;
}

# These modules need a foce install because some non-critical tests fail
# In practice, they work okay.
# So for the purposes of our one-shot install, these modules are considered "easy"
sub get_modules_need_force {
  my $self = shift or die "no object";
  my @force_mods;

  # test for Net::DNS::Resolver::Recurse fails on tektonic VPS
  # same as reported in http://www.nntp.perl.org/group/perl.cpan.testers/341522
  # but we go ahead and use this module anyway
  # I think this is needed for HTML::Widget (not 100% sure)
  push @force_mods, 'Net::DNS';
  push @force_mods, 'DBIx::Class::DigestColumns';
  return @force_mods ;
}

sub get_modules_need_manual_install {
  my $self = shift or die "no object";
  my @mods = qw(
    HTML::Widget
    Catalyst::Plugin::HTML::Widget
  );

  return @mods;
}


1;

